package com.nowcoder.service;

import com.nowcoder.entity.LoginRecord;
import com.nowcoder.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Map;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author cd
 * @since 2021-12-17
 */
public interface UserService extends IService<User> {

    public User findById(int id);

    public User findByUid(String uid);

    public User selectByName(String username);

    public User selectByEmail(String email);

    public Map<String,Object> register(User user);

    public int activation(String uid, String code);

    public Map<String,Object> login(String username, String password, int expireSeconds);

    public void logout(String token);

    public Map<String,Object> resetPassword(String email, String password);

    public LoginRecord findLoginToken(String token);

    public int updateAvatar(String uid, String avatar);

    public Map<String,Object> updatePassword(String uid, String oldPassword, String newPassword);
}
